package com.jh.user.business.impl;

import cn.jh.common.exception.ServiceException;
import cn.jh.common.utils.BeanUtil;
import cn.jh.common.utils.CommonConstants;
import cn.jh.common.utils.CommonsUtil;
import com.jh.user.business.UserBankInfoBusiness;
import com.jh.user.pojo.*;
import com.jh.user.repository.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.rowset.SqlRowSet;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.Predicate;
import java.io.File;
import java.io.IOException;
import java.util.*;

@Service
public class UserBankInfoBusinessImpl implements UserBankInfoBusiness{

	@Value("${user.bankInfo.uploadPath}")
	private String bankCardUploadPath;

	@Value("${user.bankInfo.downloadPath}")
	private String bankCardDownloadPath;

	@Autowired
	private UserBankInfoRepository userBankInfoRepository;

	@Autowired
	private BankNumberRepository bankNumberRepository;

	@Autowired
	private BankAcronymRepository bankAcronymRepository;

	@Autowired
	private UserBankNoRepository userBankNoRepository;

	@Autowired
	private EntityManager em;

	@Autowired
	private JdbcTemplate jdbcTemplate;

	@Autowired
	private BankBranchRepository bankBranchRepository;

	@Autowired
	private ChannelRepository channelRepository;

	@Autowired
	private UserAccountRepository userAccountRepository;

	@Autowired
	private ChanPayBankRepository chanPayBankRepository;


	public UserBankInfo findCreditCardManagerConfig (String brandId){
		String sql = "select * from t_bank_info where card_no = '" + brandId + "' " ;
		SqlRowSet set = jdbcTemplate.queryForRowSet(sql);

		UserBankInfo info = new UserBankInfo();
		while (set.next()){
			info.setExpiredTime(set.getString("expired_time"));
			info.setPhone(set.getString("phone"));
			info.setRepaymentDay(set.getInt("repayment_day"));
			info.setBankBrand(set.getString("bank_brand"));
			info.setNature(set.getString("nature"));
			info.setPriOrPub(set.getString("pri_or_pub"));
			info.setAbbreviation(set.getString("abb_reviation"));
			info.setQuota(set.getString("quota"));
			info.setUseQuota(set.getString("use_quota"));
			info.setLineNo(set.getString("line_no"));
			info.setCardType(set.getString("card_type"));
			info.setUserName(set.getString("user_name"));
			info.setType(set.getString("type"));
			info.setCreditBlance(set.getBigDecimal("credit_blance"));
			info.setState(set.getString("state"));
			info.setBankBranchName(set.getString("bankbranch_name"));
			info.setBankName(set.getString("bank_name"));
			info.setBillDay(set.getInt("bill_day"));
			info.setCity(set.getString("city"));
			info.setProvince(set.getString("province"));
			info.setCardNo(set.getString("card_no"));
			info.setIdcard(set.getString("id_card"));
			info.setBankAbbr(set.getString("bank_abbr"));
			info.setExpiredTime(set.getString("expired_time"));
			info.setSecurityCode(set.getString("security_code"));
			}
		return info;
	}

	@Override
	public UserBankInfo isBandingBankCard(long userId, String bankcard) {
		return userBankInfoRepository.isBandingBankCard(userId, bankcard);
	}

	/**
	 * 获取用户所有借记卡并判断是否支持畅捷通道
	 * @param userId
	 * @param cardType
	 * @param channelTag
	 * @return
	 */
	@Override
	public List<UserBankInfo> getAvailBankCardList(long userId, String channelTag, String cardType) throws ServiceException {
		// 获取畅捷通道支持银行列表
		List<ChanPayBank> chanPayNewCard = chanPayBankRepository.findAll(where("2"));
		List<ChanPayBank> businessTravel = chanPayBankRepository.findAll(where("1"));

		if (Objects.equals(cardType, "2")) {
	        cardType = CommonConstants.DEBIT_2;
        } else {
            cardType = CommonConstants.CREDIT_0;
        }
		List<UserBankInfo> bankList = userBankInfoRepository.getAvailBankCardList(userId, cardType);
		if ("CHANPAYNEWCARD_1500".equals(channelTag)) {
			// 落地商户，支持所有银行卡
			for (UserBankInfo bankInfo : bankList) {
				bankInfo.setCJFlag(1);
			}
			return bankList;
		}
		if (bankList == null || bankList.size() == 0) {
			throw new ServiceException("无可用银行卡！");
		}
		// 此处不能使用foreach
		for (int i = 0; i < bankList.size(); i++) {
		    UserBankInfo bankInfo = bankList.get(i);
			if (bankInfo != null) {
			    bankInfo.transformCardType();
				String lineNo = bankInfo.getLineNo();
				if (StringUtils.isNotEmpty(lineNo) && lineNo.length() > 3) {
					String topNo = lineNo.substring(0, 3);
					if (CommonConstants.CHANNEL_TAG_04.equals(channelTag)) {
						//商旅
						for (ChanPayBank payBank : businessTravel) {
							String bankAbbr = payBank.getBankAbbr();
							if (topNo.equals(bankAbbr)) {
								bankInfo.setCJFlag(1);
							}
						}
					}
					if (CommonConstants.CHANNEL_TAG_0101.equals(channelTag)) {
						//畅捷新无卡101
						for (ChanPayBank payBank : chanPayNewCard) {
							String bankAbbr = payBank.getBankAbbr();
							if (topNo.equals(bankAbbr)) {
								bankInfo.setCJFlag(1);
							}
						}
					}
					if (CommonConstants.CHANNEL_TAG_0102.equals(channelTag)) {
						//畅捷新无卡102
						for (ChanPayBank payBank : chanPayNewCard) {
							String bankAbbr = payBank.getBankAbbr();
							if (topNo.equals(bankAbbr)) {
								bankInfo.setCJFlag(1);
							}
						}
					}
				}
			}
		}
        return bankList;
	}
	 private Specification<ChanPayBank> where(String str) {
		return (root, criteriaQuery, criteriaBuilder) -> {
			List<Predicate> predicates = new ArrayList<>();
			CriteriaBuilder.In<Long> inPid = criteriaBuilder.in(root.get("pid"));
			String[] split = str.split(",");
			for (int i = 0; i < split.length; i++) {
				if (StringUtils.isNotEmpty(split[i])) {
					inPid.value(Long.valueOf(split[i]));
				}
			}
			predicates.add(inPid);
			return criteriaQuery.where(predicates.toArray(new Predicate[predicates.size()])).getRestriction();
		};
	 }

	@Override
	public List<UserBankInfo> queryUserBankInfoByUserid(long userid) {
		List<UserBankInfo> userBankInfoList = userBankInfoRepository.findUserBankInfoByUserid(userid);
		if (userBankInfoList != null && userBankInfoList.size() > 0) {
			for (UserBankInfo bankInfo : userBankInfoList) {
                bankInfo.transformCardType();
			}
		}
		return userBankInfoList;
	}

	@Override
	public List<UserBankInfo> queryUserBankInfoByUserid(long userid,String type) {
        List<UserBankInfo> bankInfoList = userBankInfoRepository.findUserBankInfoByUseridType(userid, type);
        for (UserBankInfo bankInfo : bankInfoList) {
            bankInfo.transformCardType();
        }
        return bankInfoList;
	}

	@Override
	public UserBankInfo queryUserBankInfoByCardno(String cardno,String type) {
        UserBankInfo bankInfo = userBankInfoRepository.findUserBankInfoByCardno(cardno, type);
        if (null != bankInfo)
        	bankInfo.transformCardType();
        return bankInfo;
    }

	@Override
	public UserBankInfo queryUserBankInfoByCardnoType(String cardno,String type) {
        UserBankInfo bankInfo = userBankInfoRepository.findUserBankInfoByCardnoType(cardno, type);
		if (null != bankInfo)
        	bankInfo.transformCardType();
        return bankInfo;
    }

	public UserBankInfo findUserBankInfoByCardNo(String cardno){
        UserBankInfo bankInfo = userBankInfoRepository.findUserBankInfoByCardNo(cardno);
        return bankInfo;
    }

	@Override
	public UserBankInfo queryUserBankInfoByLineno(String lineno) {
        UserBankInfo bankInfo = userBankInfoRepository.findUserBankInfoByLineno(lineno);
		if (null != bankInfo)
			bankInfo.transformCardType();
        return bankInfo;
    }

	@Transactional
	@Override
	public UserBankInfo saveUserBankInfo(UserBankInfo bankInfo) {
        String cardType = bankInfo.getCardType();
        if ("0".equals(cardType)) {
            bankInfo.setCardType(CommonConstants.CREDIT_0);
        }
        if ("2".equals(cardType)) {
            bankInfo.setCardType(CommonConstants.DEBIT_2);
        }
        UserBankInfo result =  userBankInfoRepository.save(bankInfo);
		long userId = bankInfo.getUserId();
		UserAccount userAccount = userAccountRepository.getUserAccount(userId);
		if (null == userAccount) {
			//绑卡时创建用户账户
			userAccountRepository.save(userAccount.initUserAccount(userId));
		}
		return result;
	}

	@Transactional
	@Override
	public UserBankInfo setDefaultBank(long userid, String cardno) {

		UserBankInfo  userBankInfo  = queryUserBankInfoByCardno(cardno,"2");
//		if (null != userBankInfo)
//			userBankInfo.transformCardType();
		List<UserBankInfo> userBankInfos = queryUserBankInfoByUserid(userid,"2");

		for(UserBankInfo  userBankInfotemp: userBankInfos){

			if(!userBankInfotemp.getCardNo().equalsIgnoreCase(userBankInfo.getCardNo())){
				userBankInfotemp.setIdDef("0");
			}else{
				userBankInfo = userBankInfotemp;

				userBankInfotemp.setIdDef("1");
			}

			saveUserBankInfo(userBankInfotemp);
		}


		return userBankInfo;
	}

	@Transactional
	@Override
	public void updateAllNoDefault(long userid,String type) {
		userBankInfoRepository.updateUserBankInfoByUserid(userid,type);
	}

	/**
	 * 查询默认银行卡
	 * @param userId
	 * @return
	 */
	public UserBankInfo findUserBankInfoByUseridAndIdDef(long userId,String idDef,String type){
		String sql = "select * from  t_bank_info where user_id=" + userId + " and is_def=" + idDef ;
		if(org.apache.commons.lang.StringUtils.isNotBlank(type)){
			sql += " and type = " + type;
		}
		SqlRowSet set = jdbcTemplate.queryForRowSet(sql);

		UserBankInfo info = new UserBankInfo();
		while (set.next()){
			info.setExpiredTime(set.getString("expired_time"));
			info.setPhone(set.getString("phone"));
			info.setRepaymentDay(set.getInt("repayment_day"));
			info.setBankBrand(set.getString("bank_brand"));
			info.setNature(set.getString("nature"));
			info.setPriOrPub(set.getString("pri_or_pub"));
			info.setAbbreviation(set.getString("abb_reviation"));
			info.setQuota(set.getString("quota"));
			info.setUseQuota(set.getString("use_quota"));
			info.setLineNo(set.getString("line_no"));
			info.setCardType(set.getString("card_type"));
			info.setUserName(set.getString("user_name"));
			info.setType(set.getString("type"));
			info.setCreditBlance(set.getBigDecimal("credit_blance"));
			info.setState(set.getString("state"));
			info.setBankBranchName(set.getString("bankbranch_name"));
			info.setBankName(set.getString("bank_name"));
			info.setBillDay(set.getInt("bill_day"));
			info.setCity(set.getString("city"));
			info.setProvince(set.getString("province"));
			info.setCardNo(set.getString("card_no"));
			info.setIdcard(set.getString("id_card"));
			info.setBankAbbr(set.getString("bank_abbr"));
			info.setExpiredTime(set.getString("expired_time"));
			info.setSecurityCode(set.getString("security_code"));


		}
		if (null != info)
			info.transformCardType();
		return info;
	}

	@Override
	public UserBankInfo queryDefUserBankInfoByUserid(long userid) throws ServiceException {
        UserBankInfo bankInfo = userBankInfoRepository.queryDefUserBankInfoByUserid(userid);
        if (null != bankInfo) {
        	bankInfo.transformCardType();
		}
        return bankInfo;
    }

	@Override
	public BankNumber queryBankNumberByBankName(String bankName) {

		return bankNumberRepository.queryBankNumberByBankName(bankName);

	}



	@Override
	public BankAcronym queryBankAcronymByBankName(String bankName) {

		return bankAcronymRepository.queryBankNumberByBankName(bankName);

	}

	@Override
	@Transactional
	public void updateUserBankInfo(UserBankInfo userBankInfo) {
		//userBankInfo.setLogo(null);
		//userBankInfo.setPhone(null);
		//userBankInfo.setBankBranchName(null);
		UserBankInfo byId = userBankInfoRepository.findById(userBankInfo.getId());
		BeanUtil.copyPropertiesIgnoreNull(userBankInfo, byId);
		em.merge(byId);
		em.flush();

	}

	@Override
	public UserBankInfo getUserBankInfo(String bankcard) {
        UserBankInfo bankInfo = userBankInfoRepository.getUserBankInfo(bankcard);
        if (bankInfo != null) {
        	bankInfo.transformCardType();
		}
        return bankInfo;
    }

	@Transactional
	@Override
	public void updateUserBankPhonebyCardno(String cardNo, String phone) {
		userBankInfoRepository.updateUserBankPhonebyCardno(cardNo, phone);
	}
	@Transactional
	@Override	public void updateUserBankInfoByCardno(String bankBranchName, String province, String city, String lineNo,
														String securityCode, String expiredTime, String bankno) {
		userBankInfoRepository.updateUserBankInfoByCardno(bankBranchName, province, city, lineNo, securityCode, expiredTime, bankno);

	}

	@Override
	public List<UserBankInfo> findNatureByUserId(long userId) {
        List<UserBankInfo> bankInfoList = userBankInfoRepository.findNatureByUserIdLikeNature(userId);
        for (UserBankInfo bankInfo : bankInfoList) {
            bankInfo.transformCardType();
        }
        return bankInfoList;
    }

	@Override
	public List<UserBankInfo> findLikeCardTypeByUserId(long userId) {
        List<UserBankInfo> bankInfoList = userBankInfoRepository.findCardTypeByUserIdLikeCC(userId);
        for (UserBankInfo bankInfo : bankInfoList) {
            bankInfo.transformCardType();
        }
        return bankInfoList;
    }

	@Override
	public List<UserBankInfo> findUserBankInfoByUseridAndCardno(long userId, String cardNo) {
        List<UserBankInfo> bankInfoList = userBankInfoRepository.findUserBankInfoByUseridAndCardno(userId, cardNo);
        for (UserBankInfo bankInfo : bankInfoList) {
            bankInfo.transformCardType();
        }
        return bankInfoList;
    }

	public UserBankInfo findUserId(long userId){
		return userBankInfoRepository.findUserId(userId);
	}

	@Override
	public UserBankInfo queryBankNameByUserIdAndCardNo(long userId, String cardNo, String type) {

        UserBankInfo bankInfo = userBankInfoRepository.queryBankNameByUserIdAndCardNo(userId, cardNo, type);
		if (null != bankInfo)
			bankInfo.transformCardType();
        return bankInfo;
    }

	//根据cardNo和brankbranchName查询用户银行信息
	@Override
	public UserBankInfo findBankNumberBybankbranchname(String bankbranchName,String cardNo) {
        UserBankInfo bankInfo = userBankInfoRepository.findBankNumberBybankbranchname(bankbranchName, cardNo);
		if (null != bankInfo)
			bankInfo.transformCardType();
        return bankInfo;
    }

	public UserBankInfo query(Long userId, String bankCardNumber){
        UserBankInfo bankInfo = userBankInfoRepository.query(userId, bankCardNumber);
		if (null != bankInfo)
			bankInfo.transformCardType();
        return bankInfo;
    }

	@Override
	public int queryCountByUserIdAndCardNoAndCardType(Long userId, String bankCardNumber, String cardType) {
		int count =0;
		if (Objects.equals(cardType, CommonConstants.DEBIT_2)) {
		    cardType = CommonConstants.DEBIT_CARD;
        } else {
            cardType = CommonConstants.CREDIT_CARD;
        }
		if("2".equals(cardType)){
			UserBankInfo user = userBankInfoRepository.queryCountByUserIdAndCardNoAndCardType(userId, bankCardNumber,"DEBIT");
			if(user != null){
				count = 1;
			}
		}else if("0".equals(cardType)){
			UserBankInfo user = userBankInfoRepository.queryCountByUserIdAndCardNoAndCardType(userId, bankCardNumber,"CREDIT");
			if(user != null){
				count = 1;
			}
		}else{
			count = 0;
		}
		return count;
	}


	@Transactional
	@Override
	public void updateBankCardByUserId(long userId) {
		userBankInfoRepository.UpdateStateByState(userId);
	}

	@Override
	public UserBankNo findBankNoByBankLocation(String bankLocation) {

		return userBankNoRepository.findBankNoByBankLocation(bankLocation);


	}

	@Override
	@Transactional
	public void updateBankLineNo(String bankNo, long userId,String bankcard) {

		userBankInfoRepository.updateUserBankNoByUserid( bankNo,userId,bankcard);
		em.flush();
	}


	@Override
	public UserBankInfo findUserBankInfoByUserIdAndCardNoAndState(Long userId, String creditCardNumber, String state,String type) {
        return userBankInfoRepository.findUserBankInfoByUserIdAndCardNoAndStateAndType(userId, creditCardNumber, state, type);
    }

	@Override
	public BankBranch getBankBranchList(String topName) {
		if (topName.contains("中国")) {
			topName = topName.replaceAll("中国", "");
		}
		String sql = "select * from t_bank_branch b where b.top_name like '%" + topName + "%' and b.bank_name like '%总行%' limit 0, 1";
		BankBranch bankBranch;
		try {
			bankBranch = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(BankBranch.class));
		} catch (Exception e) {
			bankBranch = null;
		}
		if (bankBranch == null) {
			sql = "select * from t_bank_branch b where b.top_name like '%" + topName + "%' limit 0, 1";
			bankBranch = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(BankBranch.class));
			if (bankBranch != null) {
				return bankBranch;
			}
		}
		return bankBranch;
	}

	@Override
	public Boolean supportChannel(String bankAbbr, String channelId) throws ServiceException {
		Boolean isSupport = false;

		if (StringUtils.isEmpty(bankAbbr)) {
			throw new ServiceException("查询失败，银联号为空！");
		}
		if (StringUtils.isEmpty(channelId)) {
			throw new ServiceException("查询失败，通道id为空！");
		}

		Channel channel = channelRepository.findChannelChannelNo(channelId);
		if (null == channel) {
			throw new ServiceException("查询失败，获取通道信息失败！");
		}
		String channelTag = channel.getChannelTag();
		if (StringUtils.isEmpty(channelTag)) {
			throw new ServiceException("查询失败，获取通道信息失败！");
		}

		if (CommonConstants.CHANNEL_TAG_04.equals(channelTag)) {
			//快捷商旅
			int CJSLFlag = CommonsUtil.verifyBankInfo(bankAbbr);
			/* CJFlag = 1:支持快捷商旅通道 */
			if (CJSLFlag == 1) {
				isSupport = true;
			}
		}
		if (CommonConstants.CHANNEL_TAG_0101.equals(channelTag)) {
			//畅捷新无卡101
			int newCardFreev = CommonsUtil.verifyNewCardFreevv(bankAbbr, channelTag);
			isSupport = true;
		}
		if (CommonConstants.CHANNEL_TAG_0102.equals(channelTag)) {
		    //畅捷新无卡102
            int newCardFreev = CommonsUtil.verifyNewCardFreevv(bankAbbr, channelTag);
            isSupport = true;
        }
		return isSupport;
	}

	@Override
	public List<Map<String, Object>> getBindBankInfoByUserId(long userId) {
		List<Map<String, Object>> list = new ArrayList<>();
		List<UserBankInfo> bankInfoList = userBankInfoRepository.getBindBankInfoByUserId(userId);
		if (null != bankInfoList) {
			for (UserBankInfo userBankInfo : bankInfoList) {
				userId = userBankInfo.getUserId();
				String bankName = userBankInfo.getBankName();
				String userName = userBankInfo.getUserName();
				String bankBranchName = userBankInfo.getBankBranchName();
				String lineNo = userBankInfo.getLineNo();
				String province = userBankInfo.getProvince();
				String city = userBankInfo.getCity();
				String phone = userBankInfo.getPhone();
				String cardType = userBankInfo.getCardType();
				String state = userBankInfo.getState();
				String logo = userBankInfo.getLogo();
				String abbreviation = userBankInfo.getAbbreviation();
				String cardNo = userBankInfo.getCardNo();
				String securityCode = userBankInfo.getSecurityCode();
				String expiredTime = userBankInfo.getExpiredTime();

				Map<String, Object> map = new HashMap<>();
				map.put("userId", userId);
				map.put("bankName", bankName);
				map.put("userName", userName);
				map.put("bankBranchName", bankBranchName);
				map.put("lineNo", lineNo);
				map.put("province", province);
				map.put("city", city);
				map.put("phone", phone);
				map.put("cardType", cardType);
				map.put("state", state);
				map.put("logo", logo);
				map.put("abbreviation", abbreviation);
				map.put("cardNo", cardNo);
				map.put("securityCode", securityCode);
				map.put("expiredTime", expiredTime);
				list.add(map);
			}
			return list;
		}
		return null;
	}

	@Override
	public UserBankInfo queryDefBankInfoByUserid(long userId) {
		return userBankInfoRepository.queryDefUserBankInfoByUserid(userId);
	}

	@Override
	@Transactional
	public UserBankInfo addUserBankCardInfo(UserBankInfo bankInfo, MultipartFile bankCardPhoto) throws ServiceException {
		String cardType = bankInfo.getCardType();
		if ("0".equals(cardType)) {
			bankInfo.setCardType(CommonConstants.CREDIT_0);
		}
		if ("2".equals(cardType)) {
			bankInfo.setCardType(CommonConstants.DEBIT_2);
		}

		// 保存银行卡正面图片
		uploadBankCardPhoto(bankInfo, bankCardPhoto);
		UserBankInfo result =  userBankInfoRepository.save(bankInfo);
		long userId = bankInfo.getUserId();
		UserAccount userAccount = userAccountRepository.getUserAccount(userId);
		if (null == userAccount) {
			//绑卡时创建用户账户
			userAccountRepository.save(userAccount.initUserAccount(userId));
		}
		return result;
	}

	@Override
	@Transactional
	public void updateUserBankCardInfo(UserBankInfo userBankInfo, MultipartFile bankCardPhoto) throws ServiceException {
		uploadBankCardPhoto(userBankInfo, bankCardPhoto);
		UserBankInfo byId = userBankInfoRepository.findById(userBankInfo.getId());
		BeanUtil.copyPropertiesIgnoreNull(userBankInfo, byId);
		em.merge(byId);
		em.flush();
	}

	/**
	 * 上传银行卡正面图片
	 * @param userBankInfo
	 * @param bankCardPhoto
	 */
	private void uploadBankCardPhoto(UserBankInfo userBankInfo, MultipartFile bankCardPhoto) throws ServiceException {
		if (bankCardPhoto.isEmpty()) {
			userBankInfo.setBankCardPhoto("");
		} else {
			// 上传
			String originalFilename = bankCardPhoto.getOriginalFilename();

			String[] split = originalFilename.split("\\.");
			String formatPicName = split[1];

			if (!"png".equals(formatPicName.toLowerCase())) {
				originalFilename = split[0] + ".png";
			}

			// 创建路径
			String pathStr = bankCardUploadPath + userBankInfo.getCardNo() + File.separator;
			File createFile = new File(pathStr);
			createFile.mkdirs();

			String uploadPath = pathStr + originalFilename;
			File bankCardPhotoFile = new File(uploadPath);

			try {
				bankCardPhoto.transferTo(bankCardPhotoFile);
			} catch (IOException e) {
				e.printStackTrace();
				throw new ServiceException("上传银行卡正面图片失败，请稍后再试！");
			}

			// 下载地址
			String downloadPath = bankCardDownloadPath + userBankInfo.getCardNo() + File.separator + originalFilename;
			userBankInfo.setBankCardPhoto(downloadPath);
		}
	}
}
